/**
 * 修改查询条件
 */
function doSearchUserNotice(noticeId, pageId) {
	var query = {
		"items": [
			{
				"field": "cellPhone",
				"operator": "like",
				"value": $('#' + noticeId + '_text').val()
			},
			{
				"field": "pageId",
				"value": pageId,
				"tableAlias": "unl"
			}
		]
	};
	
	searchDataGrid('#' + noticeId + '_grid', query);
}

function formatReceiveType(val, row){
	var value = val;
	if(val == 'Y'){
		value = '已查看'
	}else{
		value = '未查看'
	}
	
	return value;
}

function doResend(noticeId, pageId){
	var rows = $('#' + noticeId + '_grid').datagrid('getSelections');

	if(!rows || rows.length == 0){
		showWarningMessage('请选择要重发用户');
	}else{
        var userIds = '';
        for(var i = 0; i < rows.length; i++){
        	userIds += rows[i].id + ',';
        }
        
        userIds = userIds.substring(0, userIds.length - 1);
        
        var form = new Object();
        form.toUserIds = userIds;
        form.pageId = pageId;
        
        //console.log(form);
        
        push(form, appName + 'push/resend.json');
	} 
}

function resizeNotice(noticeId){
	$('#' + noticeId + '_grid').datagrid('resize');
}
